package com.java.comprehensive.design.building_modelling.abstract_factory_pattern.cainiao;

/**
 * @program: comprehensive-service
 *
 * @description: 抽象工厂测试类
 *
 * @author: 窦绍飞
 *
 * @create: 2021-11-24 15:56
 **/
public class AbstractFactoryPatternDemo {

	public static void main(String[] args) {

		AbstractFactory shapeFactory = FactoryProducer.getFactory(FactoryProducer.SHAPE);

		assert shapeFactory != null;
		Shape circleShape = shapeFactory.getShape(ShapeFactory.CIRCLE);
		// 调用形状方法
		circleShape.draw();




		AbstractFactory colorFactory = FactoryProducer.getFactory(FactoryProducer.COLOR);

		assert colorFactory != null;
		Color color = colorFactory.getColor(ColorFactory.RED);
		// 调用颜色方法
		color.fill();

	}
}
